import settings

from django.conf.urls.defaults import patterns, include, url

from artSightWorld.apps.base.views import *
from artSightWorld.apps.photoDisplay.views import *
from artSightWorld.apps.map.views import *
from artSightWorld.apps.addPhotos.views import *
from artSightWorld.apps.follow.views import *

from artSightWorld.apps.base.views import activate
from artSightWorld.apps.base.views import activation_complete
from artSightWorld.apps.base.views import connexion
from artSightWorld.apps.base.views import logout


urlpatterns = patterns('',
	url(r'^$', home, name='Home'),

	url(r'^profil$', profil, name='Profil'),
	#url(r'^profile$', profile, name='Profile'),
	url(r'^login$', connexion, name='connexion'),
	url(r'^logout$', logout_view, name='logout'),
	url(r'^myprofile$', myProfile, name='MyProfile'),	
	url(r'^profile/(?P<idPhotographer>\d+)$', profile, name='Profile'),
	url(r'^profile/(?P<idPhotographer>\d+)/(?P<idAlbum>\d+)$', profile, name='ProfileAlbum'),
	url(r'^editProfile/$', editProfile, name='editProfile'),
	url(r'^conditions$', conditions, name='Conditions'),
	url(r'^mentions$', mentions, name='Mentions'),
	url(r'^plandusite$', plandusite, name='Plandusite'),
	url(r'^artsightworld$', artsightworld, name='Artsightworld'),
	url(r'^recherche/$', recherche, name='Recherche'),
	url(r'^activate$', activate, name='Activate'),
	url(r'^addPhotographer/$', addPhotographer, name='addPhotographer'),
	url(r'^activation_complete$', activation_complete, name='Activation_complete'),

)

# pattern for the photo grid
urlpatterns += patterns('',
	url(r'displayLast/(?P<nbPhotoToDisplay>\d+)/(?P<numPage>\d+)/$', displayLast, name='photosLast'),
)
urlpatterns += patterns('',
	url(r'displayLastPopular/(?P<nbPhotoToDisplay>\d+)/(?P<numPage>\d+)/$', displayLastPopular, name='photosLastPopular'),
)
urlpatterns += patterns('',
	url(r'displayLastFollowed/(?P<photographeFollowing>\d+)/(?P<nbPhotoToDisplay>\d+)/(?P<numPage>\d+)/$', displayLastFollowed, name='displayLastFollowed'),
)
urlpatterns += patterns('',
	url(r'displayFollowedList/(?P<photographeFollowing>\d+)/$', displayFollowedList, name='displayFollowedList'),
)

urlpatterns += patterns('',
	url(r'displayFavorites/(?P<photographeLiking>\d+)/(?P<nbPhotoToDisplay>\d+)/(?P<numPage>\d+)/$', displayFavorites, name='displayFavorites'),
)
urlpatterns += patterns('',
	url(r'displayAlbumsList/(?P<idPhotographer>\d+)/(?P<nbPhotoToDisplay>\d+)/(?P<numPage>\d+)/$', displayAlbumsList, name='displayAlbumsList'),
	url(r'displayAlbumsList/(?P<idPhotographer>\d+)/(?P<nbPhotoToDisplay>\d+)/(?P<numPage>\d+)/(?P<myProfil>\d+)/$', displayAlbumsList, name='displayAlbumsListMyProfil'),
)
urlpatterns += patterns('',
	url(r'displayAlbumPhoto/(?P<idPhotographer>\d+)/(?P<idAlbum>\d+)/(?P<nbPhotoToDisplay>\d+)/(?P<numPage>\d+)/$', displayAlbumPhoto, name='displayAlbumPhoto'),
	url(r'displayAlbumPhoto/(?P<idPhotographer>\d+)/(?P<idAlbum>\d+)/(?P<nbPhotoToDisplay>\d+)/(?P<numPage>\d+)/(?P<myProfil>\d+)/$', displayAlbumPhoto, name='displayAlbumPhotoMyProfil'),
)
urlpatterns += patterns('',
	url(r'getPhotoComments/(?P<idPhoto>\d+)/(?P<displayAll>\d+)/$', getPhotoComments, name='getPhotoComments'),
)

#pattern for the map
urlpatterns += patterns('',
	url(r'getPhotoCoords/(?P<countryId>\d+)/$', getPhotoCoords, name='getPhotoCoords'),
)
urlpatterns += patterns('',
	url(r'getPhotoCoords/(?P<countryId>\d+)/(?P<photographerId>\d+)/$', getPhotoCoords, name='getPhotoCoordsByPhotographer'),
)
urlpatterns += patterns('',
	url(r'getPhotoCoordsByAlbum/(?P<albumId>\d+)/$', getPhotoCoordsByAlbum, name='getPhotoCoordsByAlbum'),
)
urlpatterns += patterns('',
	url(r'getVisitedCountries/(?P<photographerId>\d+)/$', getVisitedCountries, name='getVisitedCountries'),
)
urlpatterns += patterns('',
	url(r'getZoomInfo/(?P<idAlbum>\d+)/$', getZoomInfo, name='getZoomInfo'),
)

#patterns to add photos
urlpatterns += patterns('',
	url(r'addAlbum/$', addAlbum, name='addAlbum'),
)
urlpatterns += patterns('',
	url(r'addPhotos/$', addPhotos, name='addPhotos'),
)
urlpatterns += patterns('',
	url(r'checkCity/(?P<cityName>.*)$', checkCity, name='checkCity'),
)

#patterns for following
urlpatterns += patterns('',
	url(r'unfollow/(?P<idPhotographer>\d+)$', unfollow, name='unfollow'),
)
urlpatterns += patterns('',
	url(r'follow/(?P<idPhotographer>\d+)$', follow, name='follow'),
)
urlpatterns += patterns('',
	url(r'addToFavorites/(?P<idPhoto>\d+)$', addToFavorites, name='addToFavorites'),
)
urlpatterns += patterns('',
	url(r'removeFromFavorites/(?P<idPhoto>\d+)$', removeFromFavorites, name='removeFromFavorites'),
)

# pattern for the media folder
urlpatterns += patterns('',
	(r'^media/(?P<path>.*)$',
	'django.views.static.serve', {
	'document_root': settings.MEDIA_ROOT,
	'show_indexes': True,
	},
	),
)

# pattern for comments
urlpatterns += patterns('',
    (r'^comments/', include('django.contrib.comments.urls')),
)
